<?php

include_once("../config.php");
include_once("../funcao.php");
include_once('../dao/AdminDAO.php');
session_start();

if(!isset($_SESSION['admin'])){
    header("location: ../");
    exit;
}

new Conexao;

$_TITLE = ":: TCC :: Painel de Controle ::"; // na janela do navegador.

switch($_GET['p']){
    case 0:
        $pagina = "relDoSistema";
        break;
    case 1:
        $pagina = "admin";
        break;
    case 2:
        $pagina = "familia";
        break;
    case 3:
        $pagina = "func";
        break;
    case 4:
        $pagina = "prod";
        break;
    case 5:
        $pagina = "rfs";
        break;
    case 6:
        $pagina = "setor";
        break;
    case 7:
        $pagina = "unidade";
        break;
    case 8:
        $pagina = "relatorio";
        break;
    case 9: // Sair
        unset($_SESSION['admin']);
        header("location: ../");
        break;
    default:
        $pagina = "relDoSistema";
        break;
}

include(dirname(dirname(__FILE__)).'\include\coments.php');?>
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
    <?php include('head.php'); ?>
    <body>

        <div id="sombra">
            <table id="estrutura">
                <tr>
                    <td id="menu"><?php include("menu.php"); ?></td>
                    <td id="principal"><?php include("$pagina.php"); ?></td>
                </tr>
            </table>

        </div>

    </body>
</html>
